package com.lp.common.poster.entity;

import com.lp.common.poster.annotation.PosterBackground;
import com.lp.common.poster.annotation.PosterFontCss;
import com.lp.common.poster.annotation.PosterImageCss;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.awt.*;
import java.awt.image.BufferedImage;

import static com.lp.common.constant.CategoryConstant.CODE_TRAINING;

/**
 * @program: biz
 * @description:
 * @author: Ke.Song
 * @since: 2024-08-17 23:49:01
 */
@EqualsAndHashCode(callSuper = true)
@Data
public class TrainPoster extends BasePoster {

    /**
     * 背景图
     */
    @PosterBackground(width = 1029, height = 1500)
    private BufferedImage backgroundImage;

    /**
     * 横图封面
     */
    @PosterImageCss(width = 1029, height = 520, position = {0, 0})
    private BufferedImage bookImage;

    /**
     * 训练营名字
     */
    @PosterFontCss(position = {48, 543}, color = {255, 255, 255}, size = 42, style = Font.BOLD)
    private String name;

    /**
     * 价格
     */
    @PosterFontCss(position = {48, 678}, color = {255, 149, 0}, size = 66, style = Font.BOLD)
    private String price;

    /**
     * 副标题
     */
    @PosterFontCss(position = {48, 807}, color = {0, 0, 0}, canNewLine = {1, 880, 1}, size = 42,
            type = CODE_TRAINING)
    private String content;

    /**
     * 二维码
     */
    @PosterImageCss(position = {385, 1095}, width = 258, height = 258)
    private BufferedImage qrCode;
}
